package com.wlf.aiinterview.exception;

import com.wlf.aiinterview.common.ErrorCode;

/**
 * 自定义异常
 */

public class BusinessException extends RuntimeException {
    private final int code;

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(ErrorCode code, String message) {
        super(message);
        this.code = code.getCode();
    }

    public BusinessException(ErrorCode code) {
        super(code.getMessage());
        this.code = code.getCode();
    }
}
